package tool.log;

import java.util.HashMap;
import java.util.Map;

public final class LogFactory {

    private static Map cacheLogs = new HashMap();

    public static Log getLog(Class clazz) {

        return getLog(clazz.getName());
    }

    public static Log getLog(String logName) {

        synchronized (cacheLogs) {
            Log log = (Log) cacheLogs.get(logName);
            if (log == null) {
                log = new Log4JLogger(logName);
                cacheLogs.put(logName, log);
            }
            return log;
        }
    }

    private LogFactory() {

    }

}
